﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HKEA.CMS.Core.Utility
{
    public static class Converts
    {
        public static List<int> StringToList(this string strValue)
        {
            List<int> list = new List<int>();
            if (!string.IsNullOrEmpty(strValue))
            {
                string[] strlist = strValue.Split(',');
                for (int i = 0; i < strlist.Length; i++)
                {
                    int tempvalue;
                    if (Int32.TryParse(strlist[i], out tempvalue))
                    {
                        list.Add(tempvalue);
                    }
                }
            }
            return list;
        }
    }
}
